<script type="text/javascript">
    $(document).ready(function() {
        checkAmenities();
    });

    function checkAmenities() {
        var selectedAmenities = new Array();
        $.each($("input[name='amenitycbx']:checked"), function() {
            selectedAmenities.push($(this).val());
        });
        $("#amenityIDs").val(selectedAmenities);
    }    
</script>
